package edu.nyp.locationservicesapp.application;

import android.annotation.SuppressLint;
import android.content.Context;

import edu.nyp.locationservicesapp.manager.SharedPreferencesManager;
import edu.nyp.locationservicesapp.utils.LogUtil;

/**
 * 应用启动做一些启动相关的初始化操作
 * User:Gaolei  gurecn@gmail.com
 * Date:2016/10/10
 * I'm glad to share my knowledge with you all.
 */
public class LauncherModel {
    @SuppressLint("StaticFieldLeak")
    private static LauncherModel sInstance;
    private SharedPreferencesManager mSharedPreferencesManager;


    private void initData(){
        LogUtil.d("LauncherModel", "initData", "");
        Context mContext = TheApplication.getAppContext();
        mSharedPreferencesManager = new SharedPreferencesManager(mContext);
    }
    
    private LauncherModel() {
    }
    /**
     * 初始化单例,在程序启动时调用<br>
     */
    static void initSingleton(Context context) {
        sInstance = new LauncherModel();
        sInstance.initData();
    }
    /**
     * 获取实例<br>
     */
    public static LauncherModel getInstance() {
        return sInstance;
    }

    public SharedPreferencesManager getSPManager() {
        return mSharedPreferencesManager;
    }
}
